<?php

namespace ProjetA\GroupeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ProjetA\GroupeBundle\Entity\Page
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="ProjetA\GroupeBundle\Entity\PageRepository")
 */
class Page
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var array $parametre
     *
     * @ORM\Column(name="parametre", type="array")
     */
    private $parametre;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=100)
     */
    private $name;
    
    
    /**
     * @ORM\ManyToMany(targetEntity="ProjetA\GroupeBundle\Entity\Attribut")
     */
    private $attributs;
    
    
    


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set parametre
     *
     * @param array $parametre
     */
    public function setParametre($parametre)
    {
        $this->parametre = $parametre;
    }

    /**
     * Get parametre
     *
     * @return array 
     */
    public function getParametre()
    {
        return $this->parametre;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Get attributs
     * @return ArrayCollection
     */
    
      public function getAttributs()
    {
        return $this->attributs;
    }
    
    /**
     *  Ajoute un attribut dans la collection attributs[]
     * @param Attribut $attribut 
     */
    public function addAttribut(Attribut $attribut)
    {
       $this->attributs[] = $attribut;
    }
    public function setAttributs($attributs) {
        $this->attributs = $attributs;
    }
    public function findTypeAttribut($name){
        foreach ($this->attributs as $att) {
            if($att->getLibelle()== $name){
                return $att->getType();
            }
            
        }
        return false;
    }


}